//
//  RowView.swift
//  SwiftUI-CTao
//
//  Created by 涛 on 2019/9/17.
//  Copyright © 2019 涛. All rights reserved.
//

import SwiftUI

struct RowView: View {
    
    var title: String
    var description: String
    
    var body: some View {
        
        ZStack {
            RoundedRectangle(cornerRadius: 8)
                .foregroundColor(.init("defaultBackgoundColor"))
                .shadow(color: .init("defaultBackgoundColor"), radius: 1, x: 1, y: 1)
                .frame(width: UIScreen.main.bounds.width - 30, height: 80, alignment: .center)
            
            HStack(spacing: 10) {
                Text(title)
                    .foregroundColor(.init("titleColor"))
                    .font(.headline)
                    .padding(EdgeInsets(top: 0, leading: 8, bottom: 0, trailing: 0))
                
                Spacer()
                Image(systemName: "chevron.right")
                    .foregroundColor(.purple)
                    .padding(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 8))
            }
            .padding([.leading, .trailing])
        }
    }
}

struct RowView_Previews: PreviewProvider {
    static var previews: some View {
        RowView(title: "", description: "")
    }
}
